Image forming apparatus

ABSTRACT

An image forming apparatus which can reduce the required number of line buffers and random number generation circuits when performing a magnification changing process in a band process. The CPU  51  determines a range of a random number value (random number value rnd) which is generated by a random number generator, based on the scanning width (band process width d) and the length in a sub-scanning direction of an area (sub-scanning length ay). The CPU  51  receives a random number (random number value rnd), which is in the above range, and performs image processing in which a pixel is inserted or deleted at the position determined by the received random number (random number value rnd).

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present disclosure relates to an image forming apparatus which formsan image with an electrostatic latent image.

2. Description of the Related Art

In an image forming apparatus which forms an image with an electrostaticlatent image, there is a problem that the image size of the image formedon the transferring member differs from that of the image originallyintended. This is due to the fact that the size of the image isinfluenced by the variation in the attachment position and/or heatgenerated at the time of fixing the formed image.

For such a problem, US2008/089585 (A1) discloses an image formingapparatus which compares an image size of the output image with that ofan originally intended image; and measures the magnification in theformation process of the image based on the comparison result. Then, theapparatus performs a correction for the image data of the input image atthe measured magnification, and forms an image, based on the correctedimage data after the correction. As a result, an image having originallyintended size is finally output.

For example, in some image forming apparatuses, when an image formationis performed, an image size of an output image may be 101[%] of that ofan input image in a sub-scanning direction (i.e., a rotating directionof a photoreceptor). In this case, in order to output an image havingthe same image size as an input image, the image data is corrected sothat the image formation is performed in the image size obtained bymultiplying the original image size by the reciprocal of the measuredmagnification. Specifically, an image having an image size multiplied by0.990099 (i.e., reciprocal of 101[%]=100/101[%]) in the sub-scanningdirection is formed. As a result, the image size of the output imagebecomes 1.010101 . . . *99[%]=100[%] in a main scanning direction, andbecomes 0.990099*101[%]=100[%] in the sub-scanning direction.

In the magnification changing method of the input image data in theimage processing device described in US2008/089585 (A1), the number ofpixels, which corresponds to the difference of the image size of theoutput image being output without correction and the desired image sizein the sub-scanning direction, is calculated. Then, based on the numberof pixels, an image area is divided, in the sub-scanning direction, intoa plurality of areas. FIG. 15 is a diagram schematically illustratingthe input image to be processed. The input image illustrated in FIG. 15is a set of pixels arranged in the main scanning direction and in thesub-scanning direction. For example, suppose that the difference of thedesired image size and the size of the output image output withoutcorrection is 10 pixels. In this case, as illustrated in the dotted linein FIG. 15, an input image is divided into 10 areas along thesub-scanning direction. Further, for each divided area, based on arandom number value generated by a random number generator, one randomposition is determined for every coordinate position (main scanningposition) in a main scanning direction. Even in the same area, therandom positions may differ depending on the sub-scanning position. Atthe determined random position, a pixel is inserted when enlarging theimage size in the sub-scanning direction, and a pixel is deleted whenreducing the image size. When a pixel has been inserted, then a pixel atone-line behind position in the sub-scanning direction is output. Thisis called “delayed output”. When a pixel has been deleted, then a pixelpositioned at one-line advanced position in the sub-scanning directionis output. This is called “advanced output”. These “delayed” state and“advanced” state, which are generated by the insertion or the deletionof a pixel, will be initialized upon changing area.

FIG. 16 is, for a certain area, a schematic diagram for visualizing andrepresenting the random position determined based on the random numbervalue generated by a random number generator. As illustrated in FIG. 16,the coordinate value representing the main scanning position of the areais “x”, and the coordinate value representing a line number(sub-scanning position) is “y.” In FIG. 16, the dotted lines which areparallel to the main scanning direction are boundary lines (areaboundaries) of areas, and are equivalent to the dotted lines illustratedin FIG. 15. For example, when enlarging the image size of an input imagein the sub-scanning direction, a pixel is inserted at a determinedrandom position. Because of inserting a pixel, an image as illustratedin FIG. 17A (the image before enlarging) is, as illustrated in FIG. 17B,output with its image size expanded by a correction process (enlargingprocess). This correction process is a magnification changing process inwhich the image size is enlarged by one line in the sub-scanningdirection in one area. When reducing the image size in the sub-scanningdirection, a pixel is deleted in the determined random position. As aresult of deleting a pixel, the image as illustrated in FIG. 17C (theimage before reduction) is output with its image size being reduced bythe correction process (reducing process), as illustrated in FIG. 17D.This correction process is a magnification changing process in which theimage size is reduced by one line in the sub-scanning direction in onearea.

Some image forming apparatuses includes a frame buffer for storing imagedata. In this case, the magnification changing process in thesub-scanning direction is performed by performing a correction processfor the input image data stored in the frame buffer. In addition, a bandprocess is also employable as another method for storing image data. Byemploying the band process, the amount of a line memory (line buffer) inthe image forming apparatus is minimized. Therefore, an expensive framebuffer is not necessary for the image forming apparatus, and reductionof the manufacture cost of the image forming apparatus can be achieved.

Here, details of the band process will be described. FIG. 18 is adiagram schematically illustrating the input image. In the input imageillustrated in FIG. 18, 14 pixels are arranged in the main scanningdirection, 20 pixels are arranged in the sub-scanning direction, and onesquare represents one pixel. The character illustrated in each square isprovided for distinguishing, for convenience, the position in thesub-scanning direction for each pixel before performing the correctionprocess. As to a band process, it is a process for reading, from theimage data representing the whole input image, a predetermined number oflines (i.e., band processing width) in the image data, and performingimage processing on the read image data. In this process, reading out ofthe image data and image processing for the read data are repeatedlyperformed until the process for the whole input image is completed. Asan example, in the input image illustrated in FIG. 18, if the number oflines read by one scan is four lines, as illustrated in FIG. 19, theimage data consisting of 4 lines is output for every scan (i.e., scan 1to scan 5 in FIG. 19). Whole input image (FIG. 18) will be completed byrepeating 4-line reading total of 5 times, since there are 20 lines inthe sub-scanning direction.

For example, when performing a magnification changing in thesub-scanning direction in a band process which reads 4 lines at a time,generally, the number of a line buffer required for this case is 5. Foreach area and for each main scanning position, the number of a randomposition for inserting or deleting a pixel is one. Therefore, whenenlarging the image size, what is necessary is to prepare, for therandom position, one additional line which is just behind the presentline. Further, when reducing the image size, what is necessary is toprepare, for the random position, one additional line which is adjacentand advancing the present line. As an example, description is givenwhere a magnification changing process is performed on the image dataoutput of scan 2 illustrated in FIG. 19.

FIG. 20 is a figure for explaining the number of line buffers requiredfor a magnification changing process (the number of lines). When a pixelis inserted in the line at the sub-scanning position A as illustrated inFIG. 20, for example, the line data of the sub-scanning position X whichis the last line in the scan 1 (FIG. 19) is needed. When deleting apixel in the line of sub-scanning position D, the line data ofsub-scanning position Y which is a line of the first line in the scan 3(FIG. 19) is needed. Since the magnification changing process is one ofan enlarging process or reducing process, the required number of linebuffers is 5 (i.e., the sum of 4 and 1).

However, when the band process is performed in the scan including thearea boundary of each divided area, the number of line buffers mayexceed “band process width+1” and two random number generators may beneeded. Details of this case will be specifically described as below.FIG. 21 illustrates a portion of an input image having 9 pixels for thelength (sub-scanning area length) of the sub-scanning direction of anarea. The dotted lines in FIG. 21 illustrates the boundary lines ofareas, and an area boundary is defined between pixel X (character in asquare is “X”) and pixels 1 (character in a square is “1”), betweenpixel 9 (character in a square is 9) and pixels 1, and between pixel 9and pixel Y (character in a square is “Y”). In FIG. 21, seen from afront side, the upper area is defined as “area A” and downward area isdefined as “area B”. Hereinafter, description is given where themagnification changing process for reducing the image size is performed,with 4 lines band width, on the area A and the area B.

FIG. 22 illustrates, in the area A and the area B illustrated in FIG.21, a state in which random positions, at which a pixel is deleted, arespecified. FIG. 23 illustrates the result of deleting pixels at thepositions illustrated in FIG. 22, i.e., the result of performing themagnification changing process for reducing the image size. Thepositions of the shaded square illustrated in FIG. 23 represent thepositions at which a pixel is deleted in the magnification changingprocess for reduction. In FIG. 23, each of the areas A and the area B isreduced by one line in the sub-scanning direction in the magnificationchanging process, as a result, the sub-scanning area length is reducedfrom 9 pixels to 8 pixels.

FIG. 24 illustrates: 1) an output image data (from scan 1 to scan 5)when the band process is performed on the image illustrated in FIG. 23with band width being 4 lines; and 2) line data and the number of theline buffers required for the magnification changing process. Followingdescription is given in a case where the magnification of thesub-scanning direction of an image forming apparatus is small enough andthe cycle of the insertion or the deletion of a pixel is longer than theband process width. Specifically, in a case where the band process widthis four lines, in the magnification changing rate, the cycle of theinsertion or the deletion of a pixel is more than or equal to fourlines. As to the magnification in which frequency of insertion of apixel is one per 4 lines, since image data consisting of 4 lines ischanged into image data consisting of 5 lines, the magnification is5/4=1.25. Therefore, the magnification changing rate is 125[%]. Further,as to the magnification in which the deletion of a pixel occurs once per4 lines, since image data consisting of lines is changed into image dataconsisting of 3 lines, the magnification is ¾=0.75. Therefore, themagnification changing rate is 75[%]. In the following, description isgiven assuming that the magnification changing rate is in the range of75[%] to 125[%]. It is noted that the range of the magnificationchanging rate frequently used in a known image forming apparatus is99[%] to 101[%]. The above-mentioned magnification range may differ inthe image forming apparatus with a different band process width.However, even in the case, the band process width is about 32 lines atthe maximum, therefore, as compared to the range of 99[%] to 101[%], theabove mentioned range of 75[%] to 125[%] is sufficiently wide.

As illustrated in FIG. 24, in scan 1, scan 2, scan 4, and scan 5, therequired number of the line buffers is five. However, in scan 3, asillustrated, the required number of line buffers is six. Among scans 1to 5, only in scan 3, the required number of line buffers increases one.This is due to the fact that scan 3 is performed over the area A and thearea B for performing the band process on these lines. Usually, for eachmain scanning position, the insertion or the deletion of a pixel occursonce for every scan.

However, in a scan over two or more areas, Depending on the combinationof 1) the random number value used for the process of the area A; and 2)the random number value used for the process of the area B, in the samemain scanning position, the insertion or the deletion of a pixel mayoccur twice. For example, in the main scanning position P of scan 3illustrated in FIG. 24, the deletion of a pixel has occurred twice. Whenperforming the band process on the line over the area A and area B, arandom number value should be generated for each of the area A and thearea B. Further, the generated random number values must be stored.Therefore, both line buffers for image processing for a scan over theareas and two random number generator should be previously provided inan image forming apparatus. Therefore, there remains a problem that themanufacturing cost of an image forming apparatus is increased.

The present disclosure is directed to provide an image forming apparatuswhich can reduce the required number of line buffers and random numbergeneration circuits when performing a magnification changing process ina band process.

SUMMARY OF THE INVENTION

An image forming apparatus of the present disclosure includes a dividingunit configured to divide received image data into two or more areas; arandom number generation unit configured to generate a random numbervalue for specifying a position for inserting or deleting a pixel foreach divided area; a determination unit configured to determine a rangeof a random number value generated by the random number generation unitbased on a scanning width of in a scan of the image data in a mainscanning direction and a length in a sub-scanning direction of the area;and an image processing unit configured to perform image processing forinserting or deleting a pixel in the specified position specified by therandom number value within the determined range.

Further features of the present invention will become apparent from thefollowing description of exemplary embodiments (with reference to theattached drawings).

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a schematic sectional view of an image forming apparatus.

FIG. 2 is a diagram illustrating a configuration of an exposure controlunit and photoreceptor.

FIG. 3 is a block diagram illustrating a configuration example of animage processing unit and its peripherals.

FIG. 4 is an exemplary flowchart illustrating procedures of a reducingor enlarging process.

FIG. 5 is a flowchart continued from FIG. 4.

FIG. 6 is a schematic diagram illustrating stored data in line buffersbefore and after performing each process of steps S511 to S515.

FIG. 7 is a diagram illustrating a process of change of a counter vacntfor each scan.

FIG. 8 is a flowchart illustrating a specific procedure for generatingrandom values.

FIG. 9A is a diagram illustrating a principle of operation of a randomnumber generator, and FIG. 9B illustrates the seed value of the randomnumber output circuit after a shift.

FIG. 10 is a flowchart illustrating an example of specific procedures ofan image output process.

FIG. 11 is an exemplary diagram illustrating possible values of acounter vacnt when performing a scan over an area A and an area B.

FIG. 12 is an exemplary diagram explaining a relation of a line bufferand an output image in a reducing process.

FIG. 13 is an exemplary diagram explaining a reducing process.

FIG. 14 is an exemplary diagram explaining an enlarging process.

FIG. 15 is a diagram exemplifying area division of the input image.

FIG. 16 is a diagram explaining determination of a random position atwhich a pixel is inserted or deleted.

FIG. 17A is a diagram illustrating an input image before enlarging, FIG.17B is a diagram illustrating an image after enlarging, FIG. 17C is adiagram illustrating an input image before reduction, and FIG. 17D is adiagram illustrating an image after reduction.

FIG. 18 is a diagram illustrating an exemplification of an input image.

FIG. 19 is a diagram explaining as an example that an input image isoutput by the band process every four lines.

FIG. 20 is a diagram explaining the number of line buffers required fora magnification changing process.

FIG. 21 is a diagram illustrating a part of an input image divided intoareas.

FIG. 22 is a diagram illustrating a state in which random positions, atwhich a pixel is deleted, are specified in an area A and an area B.

FIG. 23 is a diagram illustrating the result of the deletion of pixelsat the positions illustrated in FIG. 22.

FIG. 24 is a diagram illustrating, in case a band process is performed,output image data, required line data, and the number of line buffers.

DESCRIPTION OF THE EMBODIMENTS First Embodiment

Now, hereinafter, an embodiment of this invention will be described withreference to the accompanying drawings. FIG. 1 is a schematiclongitudinal sectional view of an image forming apparatus according tothe present embodiment. The image forming apparatus 110 includes adocument feeding unit 111 for feeding documents to a predeterminedreading portion, image reading unit 112 for reading the fed documents,and an image forming unit 113 for forming an image based on image data.It is noted that the image forming apparatus 110 has two modes, i.e., acopy mode and a printer mode. In a copy mode, the image formingapparatus 110 receives image signal (image data) which is read andobtained by image reading unit 112, and prints the received image data.In a printer mode, the image forming apparatus 110 receives image signal(image data) which is output from external PC 48, which is describedlater, and prints the received image data. Hereinafter, with referenceto FIG. 1, basic operations of an image forming apparatus 110 isexplained.

In the copy mode, the documents on a document feeder 1 of the documentfeeding unit 111 is fed one by one onto a document glass plane 2 of theimage reading unit 112. After feeding a document, a lamp 3 provided on ascanner unit 4 of the image reading unit 112 is lit to irradiate lighton a surface of the document, and the scanner unit 4 moves in thesub-scanning direction. The reflected light from the surface of thedocument passes through a condensing section 8 via mirrors 5 and 7,which are provided on a scanner unit 4, then, the reflected light isinput to the an image sensor 9. The image sensor 9 converts thereflected light into an image signal (image data), and outputs theobtained image data to an exposure control unit 10 of an image formingunit 113. In the printer mode, the image data received from the externalPC 48 is output to the exposure control unit 10.

The exposure control section 10 controls a laser drive device providedthereon to generate a laser beam according to the received image data.The latent image formed by irradiation of the laser beam on aphotoreceptor 11 is monitored by a potential sensor 100 to determinewhether the potential on the photoreceptor 11 is a desired value or not.If the monitored value is a desired value, development unit 13 performsdevelopment. The photoreceptor 11 is rotated to be in synchronism withthe exposure control unit 10 for every output line of exposure controlunit 10. Further, the photoreceptor 11 forms an image by repeating aone-way line scan. In accordance with latent image forming timing, atransfer member is conveyed from a transfer member tray 14 or 15, and,in transferring unit 16, the developed toner image as described above istransferred on the surface of the transferring member. The transferredtoner image is fixed on the transferring member by a fixing unit 7, andthe transferring member is discharged from a pair of discharge rollers18 to the exterior of the image forming apparatus. The surface of thephotoreceptor 11 is, after the transfer, cleaned by a cleaner 25. Thecleaned surface of the photoreceptor 11 is neutralized with an auxiliaryelectrification unit 26, and is adjusted by primary electrification unit28 to obtain proper electrification. Then, the remaining electric chargeon the photoreceptor 11 neutralized by an exposure lamp 27, and thesurface of the photoreceptor 11 is electrified by the primaryelectrification unit 28. The image forming apparatus 10 repeats theimage forming processing by the following configuration.

When forming image on both sides of the transferring member, after animage was formed on the surface of the transferring member, when theback end of the transferring member conveyed from the fixing unit 17 isdetected by a sheet detection unit 19, the rotation of the pair ofdischarge roller is stopped. A flapper 20 provided in an ejectionpassage 21 switches a passage for the transferring member to a reversalpassage 22. Then, the rotation direction of the discharge roller pair 18is reversed and the transferring member is conveyed to the reversalpassage 22. The transferring member is conveyed via a reversalconveyance path entrance 23 from the reversal passage 22 to reversalconveyance path 24. The transferring member is again conveyed from thereversal conveyance path 24 to the transferring unit 16, and an image isformed on the back of the transferring member as described in the abovementioned image forming operation.

FIG. 2 is a configuration diagram illustrating the exposure control unit10 and the photoreceptor 11. Exposure control unit 10 and photoreceptor11 exposure control unit 10 include a semiconductor laser 43, laserdrive device 31, diaphragm 32 and rotating polygon mirror (hereinafterdescribed as “polygon mirror”) 33, f-θ lens 34, collimating lens 35, andbeam detection sensor (herein after described as “BD sensor”) 36. Theexposure control unit 10 also includes an image processing unit 50. Theexposure control unit 10 exposes the surface of the photoreceptor 11 byscanning the laser beam, which is pulse width modulated according to theimage data, in a main scanning direction.

The image data received from the image sensor or the external PC 48 isinput to the image processing unit 50. The image processing unit 50performs PWM (pulse width modulation) table conversion on the image dataaccording to the imaging mode of the image forming unit 110, and outputsthe resulting data as a laser drive signal to the laser drive device 31.The laser drive device 31 receives a laser drive signal from the imageprocessing unit 50, and drives the semiconductor laser 43 based on thelaser drive signal.

Provided inside the semiconductor laser 43 is a PD (photo-diode) sensor(not shown) for detecting a part of a laser beam. The image processingunit 50 performs auto power control for a laser diode based on thedetection signal of PD sensor. The laser beam emitted from thesemiconductor laser 43 is adjusted, by the collimating lens 35 and thediaphragm 32, to be substantially parallel light. Then, the laser beamenters into the polygon mirror 33 with a predetermined beam diameter.The polygon mirror 33 is driven by a driving device (not shown) torotate with a constant angular velocity in the direction illustrated byan arrow Q in FIG. 2. With this rotation, the entered laser beam isreflected to be a deviation beam, and the angle of which is continuouslydisplaced.

The deviation beam is condensed with f-O lens 34. At this time, F-θ lens34 corrects distortion aberration of a deviation beam in that case.Therefore, the deviation beam is scanned at a constant velocity in thedirection of the arrow P on the photoreceptor 11, which serves as animage support object. BD sensor 36 detects the reflected light frompolygon mirror 33. The detection signal which is output from the BDsensor is a synchronization signal (main scanning synchronizationsignal) for synchronizing the rotation of polygon mirror 33 and thewriting of image data for keeping the image formation position in themain scanning direction constant.

Through the processes described above, an image is formed on the surfaceof the transferring member. Upon forming an image, heat is applied whenfixing the transferred toner image in the fixing unit 17. However, thetransferring member may be expanded or reduced by this heat. The elasticrate of the transferring member mainly depends on the constituentmaterial of the transferring member. Therefore, for example, byspecifying the type of transferring member by a user before printing,and performing a magnification changing process by the image processingunit 50 at a reciprocal of the elastic rate according to the specifiedtype image, the expansion or reduction of the material can becompensated. Specification of the type of transferring member can beperformed via the external PC 48 or via a control panel 49 describedlater, for example.

FIG. 3 is a block diagram illustrating a configuration example of animage processing unit 50 and its peripherals. The image processing unit50 includes a CPU (Central Processing Unit) 51, an image selector 52, aline buffer 53, and a random number buffer 54. The image processing unit50 is connected to the scanner unit 4, the image sensor 9, the BD sensor36, the external PC 48, the control panel 49, and the laser drive device31. The CPU 51 controls each constitution devices included in the imageprocessing unit 50 and the image forming unit 110. The image selector 52selects image data to receive depending on the mode, i.e., the copy modeor the printer mode. Specifically, in the copy mode, the image selector52 operates to select image data C which is output from the image sensor9, as illustrated in FIG. 3. In the printer mode, the image selector 52operates to select image data P which is output from the external PC 48,as illustrated in FIG. 3. The line buffer 53 stores image data of apredetermined line. The random number buffer 54 stores the random numbervalues for one area generated by the CPU 51.

In response to receipt of a print start instruction from a user, theexternal PC 48 outputs an image formation start signal P. Further, theexternal PC 48 outputs a magnification P set by the user. Themagnification P is set by the user when performing reduced printing witha magnification of 90%, or enlarged printing with a magnification of110%, for example. In response to receipt of an image data requestsignal P from the CPU 51, the external PC 48 outputs image data P for asingle line. In response to receipt of a copy start instruction from auser, the control panel 49 outputs an image formation start signal C.Further, the control panel 49 outputs a magnification C set by the user.The magnification C is set by the user when performing reduced printingwith a magnification of 90%, or enlarged printing with a magnificationof 110%, for example. In response to receipt of an image data requestsignal C from the CPU 51, the scanner unit 4 moves in the sub-scanningdirection for outputting image data for a single line from the imagesensor 9.

Now, description is made for the movement in the sub-scanning directionof scanner unit 4, in the exemplary case where the resolution of theimage forming unit 110 is 600 [dpi]. With the resolution of 600 [dpi],the width of a line is obtained by 25.4 [mm]/600 [dpi]. In this case,the width of a line is 0.04233 [mm]. If a scanner unit 4 have moved0.04233 [mm] in the sub-scanning direction, it means that the scannerunit 4 have moved a distance corresponding to the width of a line incase of resolution 600 [dpi]. The image sensor 9 converts a result of ascan at the position after the movement into an image signal. Theconverted image signal is output as the image data C. It is noted thatthe image data request signal C and the image data request signal P aregenerated two or more times during imaging operations for 1 page. Forexample, when the whole page of 210 [mm] is imaged in the sub-scanning,the demand signal occurs 210 [mm]/0.04233 [mm] 4960 [times]. The timingof occurrence will be described later.

FIGS. 4 and 5 are exemplary flowcharts illustrating procedures of thereducing or the enlarging processes. First, the reducing process in theprinter mode is explained. In response to receipt of the image data Pand the image formation start signal P from the external PC 48, theimage forming unit 110 starts imaging. It is noted that the input imagereceived as the image data P is a set of pixels arranged in the mainscanning direction and in the sub-scanning direction. Hereinafter,description is made in a case where a main scanning direction inputimage size in_x, which represents a length in the main scanningdirection, is 14 pixels, and a sub-scanning direction input image sizein_y, which represents a length in the sub-scanning direction, is 20pixels. Further, in this case, a band process width d is 4 pixels (fourlines), a magnification p is 90.9090 . . . [%], and the number L oflines of the line buffer 53 is set to 5 (i.e., d+1=4+1=5). Each line ofthe line buffer 53 is defined as line buffer L0, L1, L2, L3, and L4.

The CPU 51 obtains the image size (i.e., the value of the scanningdirection input image size in_x, and the value of the sub-scanningdirection input image size in_y) of the input image (S501).Specifically, the pixel sequence of the main scanning direction consistsof 14 pixels, and the pixel sequence of the sub-scanning directionconsists of 20 pixels. The CPU 51 obtains magnification information(i.e., the value of the magnification p) from the external PC 48 (S502).Specifically, the value is 90.9090 . . . [%]. The CPU 51 divides aninput image along the sub-scanning direction, and calculates the numberof pixels of a sub-scanning length ay for every divided area (S503). Ina reducing process, ay can be obtained by the following formula 1, sinceone pixel is deleted from the pixel sequence of the sub-scanningdirection in each area.

(ay−1)/ay=p/100  (formula 1)

The formula 1 can be written as a following formula 2.

ay=100/(100−p)  (formula 2)

The sub-scanning length ay in the reducing process is set toay=100/(100−90.9090 . . . )=11 [pixels]. This means that the deletion ofone pixel is performed at a frequency of one time per 11 lines.

The CPU 51 initializes each of a sub-scanning counter vcnt and a countervacnt (S504). The sub-scanning counter vcnt is provided for counting thetotal number of the output lines in an output image. Due to the processof step S504, the value of the sub-scanning counter vcnt is initializedto 0 (zero). The counter vacnt is provided for counting the number ofthe output lines in each area. The maximum value of the counter vacnt(max) in the reducing process is expressed as follows: vacnt(max)=ay−1−1. Since the initial value of the counter vacnt is “0”,therefore, ay is subtracted by 1 (i.e., first “−1” in the aboveformula). Further, the initial sub-scanning length consists of 11 pixelswhile the current sub-scanning length consists of 10 pixels so that thearea is terminated with lack of 1 pixel, therefore, ay is furthersubtracted by 1 (i.e., second “−1” in the above formula. It is notedthat the Maximum value vacnt (max) for the counter vacnt in theenlarging process is as follows: vacnt (max)=ay−1+1. Details will bedescribed later.

Since the band process width d consists of four lines, the number “4” isadded to the value of the counter vacnt for every one scan (+4).However, because of addition, when the value of the maximum vacnt (max)is exceeded, restarting the count from “0” for the count in excess ofthe value of the maximum vacnt. Here, in the image data output from theband process, the 1st, 2nd, 3rd and 4th lines of the counter vacnt aredefined as the counter vacnt (0), the counter vacnt (1), the countervacnt (2) and the counter vacnt (3), respectively. After initializingthe counter vacnt, the counter vacnt (0)=0, the counter vacnt (1)=1, thecounter vacnt (2)=2, and the counter vacnt (3)=3.

The CPU 51 initializes line buffer 53 (S505). Specifically, all thebuffers of the line buffers L0, L1, L2, L3, and L4 are overwritten bydata 0. The CPU 51 determines whether the main scanning synchronizationsignal was received from the BD sensor 36 or not (S506). In response toreceipt of the main scanning synchronization signal (S506: yes), the CPU51 determines whether the area is updated or not, i.e., the process isstarted at new area or not (S507). Specifically, if any of the values ofthe count vacnt (0) to count vacnt (3) is 0, it is possible to determinethat the area is updated. If it is determined that the area is updated(S507: yes), the process proceeds to Step S508. If not (S507: no), theprocess proceeds to Step S515.

The CPU 51 determines whether the output of an image is the firstscanning (i.e., first time scan) or not (S508). Specifically, if thevalue of the sub-scanning counter vcnt is 0, it will determine that theoutput corresponds to the first scanning. If it is determined to be thefirst scan, (S508: yes), the process proceeds to Step S510. If not(S508: no), the process proceeds to S509. The CPU 51 determines, basedon the value of the magnification p, whether the process is the reducingprocess or the enlarging process (S509). If it is determined to be thereducing process, (S509: yes), the process proceeds to Step S511. If not(S509: no), the process proceeds to S512. The CPU 51 determines, basedon the value of the magnification p, whether the process is the reducingprocess or the enlarging process (S510). If it is determined to be thereducing process, (S510: yes), the process proceeds to Step S513. If not(S510: no), the process proceeds to Step S514.

The CPU 51 updates the line buffer 53 (S511). Specifically, the CPU 51outputs the image data request signal P to the external PC 48 fivetimes. Then, the image data for five lines, which is output from theexternal PC 48 in response to the image data request signal P, is storedin the line buffers L0, L1, L2, L3 and L4 in this order. The CPU 51updates line buffer (S512). Specifically, the CPU 51 copies the imagedata stored in the line buffer L3, and stores the copied image data inthe line buffer L0. Further, the CPU 51 copies the image data stored inthe line buffer L4, and stores the copied image data in the line bufferL1. Then, the CPU 51 outputs the image data request signal P to theexternal PC 48 three times. Then, the CPU 51 stores the image data forthree lines, which is output from the external PC 48 in response to theimage data request signal P, in the line buffers L2, L3, and L4 in thisorder.

The CPU 51 prepares the line buffer 53 (S513). The process of step S513is a process which stores the image data in the line buffer 53 in orderto perform the reducing process in the first scan. Specifically, the CPU51 outputs the image data request signal P to the external PC 48 fivetimes. Then, the image data for five lines, which is output from theexternal PC 48 in response to the image data request signal P, is storedin the line buffers L0, L1, L2, L3 and L4 in this order. The CPU 51prepares the line buffer (S514). The process of step S514 is a processwhich stores the image data in the line buffer 53 in order to performthe enlarging process in the first scan. Specifically, the CPU 51overwrites the image data stored in the line buffer L0 with data 0 forclearing all data. The CPU outputs the image data request signal P tothe external PC 48 four times. Then, the data for four lines, which isoutput from the external PC 48 in response to the image data requestsignal P, is stored in the line buffers L0, L1, L2, L3 and L4 in thisorder.

The CPU 51 updates the line buffer 53 (S515). Specifically, the CPU 51copies the image data stored in the line buffer L4, and stores thecopied image data in the line buffer L0. The CPU 51 outputs the imagedata request signal P to the external PC 48 four times. Then, the imagedata for four lines, which is output from the external PC 48 in responseto the image data request signal P, is stored in the line buffers L0,L1, L2, L3 and L4 in this order.

Here, description is made for the image data stored in each of linebuffers L0, L1, L2, L3 and L4 before and after performing each processof steps S511 to S515. FIG. 6 is a schematic diagram illustrating thestored data in each of the line buffers L0, L1, L2, L3 and L4 before andafter performing each of steps S511 to S515. In FIG. 6, the state beforeperforming the process of each step is represented as “beforeupdating/preparation”, and the state after performing the process ofeach step is represented as “after updating/preparation”. For example,“line1” illustrated in FIG. 6 represents the image data of the firstline of the input image. Further, “N” illustrated in FIG. 6 representsarbitrary integers more than or equal to 1. “0 (data 0)” illustrated inFIG. 6 indicates that the value of all the data is “0” regardless of theinput image. The shaded line in FIG. 6 represents the image datacommonly used before and after the process. For example, in the processof step S512, it is “line N+3” and “line N+4”.

Returning to FIG. 5, The CPU 51 generates random numbers rnd for all themain scanning positions in one scan (S516). In the image forming unit110 of this embodiment, the range of the generated random number valuernd is defined by the maximum value and the minimum value. Further, therange is restricted to “0” to “the maximum value vacnt (max) of thecounter vacnt−the band process width d+1”. For example, when the valueof the maximum vacnt (max) is 9 and the band process width d is 4, theCPU 51 restrict the range of a random number value rnd, which are usedfor specifying the random positions to “0” to “6”. The details of therange of a random number value rnd are explained in the description forstep S702 (FIG. 10), which is described later. Further, specificprocedures for generating the random numbers are explained in thedescription for step S600 to step S607 (FIG. 8), which is describedlater.

Each process of step S517 to step S524 is an image processing in onescan. The CPU 51 initializes the main scanning position x to 0 (S505).The CPU 51 obtains the random number value rnd corresponding to the mainscanning position x from the random number buffer 54 (S518). The CPU 51performs a magnification changing process based on the obtained randomnumber value rnd, the value of the magnification p and each value of thecounter vacnt (0) to the counter vacnt (3) (S519). As to the specificprocedures of the magnification changing process are explained in eachprocess of step S700 to step S714 (FIG. 10) described later. The CPU 51updates the main scanning position x (S520). Specifically, “1” is added(+1) to the value of main scanning position x. The CPU 51 compares thevalue of the main scanning position x with the value of the mainscanning direction input image size in_x of the input image. Then, theCPU 51 determines whether the image processing has been performed forall the main scanning positions (S521). Specifically, when the condition“x in_x−1” is satisfied, the CPU 51 determines that the image processinghas been performed for all the main scanning positions. If it isdetermined that image processing has been performed for all the mainscanning positions (S507: yes), the process proceeds to S522. If not(S521: no), the process proceeds to Step S518.

The CPU 51 updates the counter vacnt (S522). Specifically, adding “4” toeach of the values of the count vacnt (0) to count vacnt (3). However,as described above, the maximum vacnt (max) of the counter vacnt at thetime of the reducing process, vacnt (max)=ay−1−1. Therefore, when themaximum value is exceeded, restarting the count from “0” for the countin excess of the value of the maximum vacnt.

As an example, description is made in a case where update is performedwith ay=11, vacnt (max)=9, vacnt (0)=5, vacnt (1)=6, vacnt (2)=7, andvacnt (3)=8. In this case, the counter vacnt (0) to the counter vacnt(3) are updated as shown in the following (a)-(d).

(a) (vacnt (0): 5+4=9, thus the vacnt (0)=9

(b) vacnt (1): 6+4=10, thus the vacnt (1)=0

(c) vacnt (2): 7+4=11, thus the vacnt (2)=1

(d) vacnt (3): 8+4=12, thus the vacnt (3)=2

Each value of the counter vacnt (0) to the counter vacnt (3) for eachscan is illustrated in FIG. 7. As illustrated in FIG. 7, for example,the value of the counter vacnt (0) is “6” in the 5th scan, and “0” inthe 6th scan.

The CPU 51 updates the sub-scanning counter vcnt (S523). Specifically,“4” is added (+4) to the value of the sub-scanning counter vcnt. The CPU51 determines whether the output of the image has been completed or not(S524). The total number of the lines of the output image is obtained bymultiplying the value of the sub-scanning direction input image sizein_y by the value of the magnification p. Specifically, when “vcnt[in_y*p] (“[ ]” is a sign representing the largest integer not greaterthan the value inside “[ ]”) is satisfied, it is determined that all theimage outputs have been completed. When it is determined that all theimage outputs have been completed (S524: yes), a series of imaging iscompleted. If not (S524: no), the process proceeds to Step S506 and theimage processing for the next scan is performed. As for sub-scanningdirection input image size in_y, the count starts from “1”, and, as forsub-scanning counter vcnt, the count starts from “0”.

Description is specifically made with regard to step S516. FIG. 8 is aflowchart exemplary illustrating a specific procedure in step S516(procedures for generating random value rnd). The CPU 51 initializes themain scanning counter xx (XX=0) (S601). The CPU 51 generates one randomnumber (S602). Here, the details of the random number value will bespecifically described. In this embodiment, as an example of a randomnumber output circuit, a circuit for generating a random number valuebased on pseudorandom number generation with the use of primitivepolynomial is described. FIGS. 9A and 9B are the schematic diagramsillustrating a random number output circuit in which 16th primitivepolynomial is embedded. The random number output circuit is configuredby providing 16 binary recording elements in cascade connection andproviding 3 logical operation circuits, each of which intervenes betweenthe record elements. In these figures, two or more recording elementsare defined as bit 15 to bit 0 (in FIG. 9A, it is indicated as “15, 14,. . . ”), respectively. Further, an EXOR gate, which is an example of alogical operation circuit, intervenes between bit 14 and bit 13.Similarly, intervening EXOR gates are provided between bit 13 and bit12, and between bit 11 and bit 10. A seed value serves as a species of arandom number value. Further, the seed value is defined as a set ofbinary data of each bit of the random number output circuit.

In FIG. 9A, the seed value of the random number output circuit is“1111011011001001”. Here, description is made for finding the minimumindex n which satisfies the condition “2^(n) exceeds the maximum valueof the random number”. Since the maximum number of the random numbervalue is 6, in this embodiment, n is found to be 3 (n=3). The value ofthis index n corresponds to the number of bits to be obtained from therandom number output circuit illustrated in FIG. 19 for satisfying theabove condition. In this embodiment, 3 bits, i.e., bit 2, bit 1 and bit0 are obtained from the seed value.

For example, the generated random number value is determined based onthe outputs of bit 2 to bit 0 of this seed value. In FIG. 9A, if thevalues of bit 2 to bit 0 are arranged in this order, the result is“001”. By converting binary to decimal, from the above result, a randomnumber value “1” is generated. When it is necessary to generate a randomnumber value again, the binary data stored in the recording element isshifted in the predetermined direction to adjacent recording elements,thereby changing the seed value, and next random number value isgenerated based on the changed seed value. Specifically, the seed valuefor the random number output circuit is shifted rightward. The specificprocedures for generating a random number value again, by shifting theseed value for the random number output circuit rightward, is asfollows.

(a) Save the value of bit 0 in temporary variable temp (not shown).

(b) Assign the value of bit 1 to the value of bit 0.

(c) Assign the value of bit 2 to the value of bit 1.

(d) Assign the value of bit 3 to the value of bit 2.

(e) Assign the value of bit 4 to the value of bit 3.

(f) Assign the value of bit 5 to the value of bit 4.

(g) Assign the value of bit 6 to the value of bit 5.

(h) Assign the value of bit 7 to the value of bit 6.

(i) Assign the value of bit 8 to the value of bit 7.

(j) Assign the value of bit 9 to the value of bit 8.

(k) Assign the value of bit 10 to the value of bit 9.

(l) Assign the EXOR value of the value of the temporary variable tempand the value of bit 11 to the value of bit 10.

(m) Assign the value of bit 12 to the value of bit 11.

(n) Assign the EXOR value of the value of the temporary variable tempand the value of bit 13 to the value of bit 12.

(o) Assign the EXOR value of the value of the temporary variable tempand the value of bit 14 to the value of bit 13.

(p) Assign the value of bit 15 to the value of bit 14.

(q) Assign the value of the temporary variable temp to the value of bit15.

Thus, by performing the processes (a) to (q), next random number valuegenerated.

FIG. 9B illustrates the seed value for the random number output circuitafter the shift. Here, as in the above example, the generated randomnumber value is determined based on the outputs of bit 2 to bit 0 ofthis seed value. In FIG. 9B, if the values of bit 2 to bit 0 arearranged in this order, the result is “100”. By converting binary todecimal, from the above result, a random number value “4” is generated.

Returning to FIG. 8, the CPU 51 determines whether the random numbervalue rnd generated in the process of step S602 satisfies the determinedrange or not (S603). In this embodiment, it is determined whether thegenerated random number value rnd is within the range of “0” to “6.” Ifthe generated random number value rnd is out of the range (S603: no),the CPU 51 shifts the seed value for the random number output circuit(S604). Then, random number value rnd is again generated. If thegenerated random number value rnd is within the range (S603: yes), i.e.,the generated random number value rnd is less than or equal to “6”, theCPU 51 stores this random number value rnd in the random number buffer54 (S605). Then, the CPU 51 increments the main scanning counter xx by 1(S606). Specifically, the value of the main scanning counter xx will beas follows: xx=xx+1. The CPU 51 determines whether the generation of therandom numbers for all the main scanning positions has completed or not(S607). As for main scanning direction input image size in_x, the countstarts from “1”, and, as for main scanning counter xx, the count startsfrom “0”. When the condition “main scanning position xx main scanningdirection input image size in_x−1” is satisfied, it is determined thatthe generation of the random number values corresponding to all the mainscanning positions has completed. If it is determined that thegeneration has completed (S607: yes), the process proceeds to Step S608.If not (S607: no), the process returns to Step S602. Thus, all therandom number values rnd corresponding to all the main scanningpositions are stored in the random number buffer 54 through theprocesses of step S601 to step S607.

Description is specifically made with regard to step S519 illustrated inFIG. 5. FIG. 10 is a flowchart exemplary illustrating a specificprocedure in step S519 (image output process). The proceduresillustrated in FIG. 10 is performed on each of the counter vacnt (0),the counter vacnt (1), the counter vacnt (2), and the counter vacnt (3).That is, the process using the counter vacnt (0) determines the data ofthe 1st line of the output image, and the process using the countervacnt (1) determines the data of the 2nd line of the output image.Further, the process using the counter vacnt (2) determines the data ofthe 3rd line, and the process using the counter vacnt (3) determines thedata of the 4th line. Here, as for a typical example, description ismade for the counter vacnt (0). It is noted the same applies to thecounter vacnt (1), counter vacnt (2), and counter vacnt (3).

The CPU 51 determines, based on the value of the magnification p,whether the process is the reducing process or the enlarging process(S701). If it is determined to be the reducing process, (S701: yes), theprocess proceeds to Step S702. If not (S701: no), the process proceedsto Step S708. Here, since the process is a reducing process (S701: yes),the process proceeds to Step S702. It is noted that each process of stepS708 to step S713 are performed in the enlarging process describedlater.

The CPU 51 compares the counter vacnt (0) with the sub-scanning lengthay and the band process width d (S702) in an area. Specifically, whenthe formula “vacnt(0)≦vacnt(max)−d+1” is satisfied (S702: yes), theprocess proceeds to step S703. If not (S702: no), the process proceedsto S707. Here, “vacnt(max)−d+1” of the formula in step S702, i.e.,“vacnt(0) vacnt(max)−d+1” is explained. When performing the band processnear a boundary of the areas, the band process may be performed over twodifferent areas. For example, in a single scan, the first line and thesecond line may belong one area (e.g., area A) while the third line andthe fourth line may belong to another area (e.g., area B).

FIG. 11 is an exemplary diagram illustrating possible values of thecounter vacnt (0) to the counter vacnt (3) when performing a scan overan area A and an area B.

Since the band process width d consists of four lines, in the patterns(a) to (e) illustrated in FIG. 11, the values of the vacnt (0) to thevacnt (4) are as follows.

(a): vacnt (0)=0, vacnt (1)=1, vacnt (2)=2, vacnt (3)=3

(b): vacnt (0)=9, vacnt (1)=0, vacnt (2)=1, vacnt (3)=2

(c): vacnt (0)=8, vacnt (1)=9, vacnt (2)=0, vacnt (3)=1

(d): vacnt (0)=7, vacnt (1)=8, vacnt (2)=9, vacnt(3)=0

(e): vacnt (0)=6, vacnt (1)=7, vacnt (2)=8, vacnt(3)=9

In FIG. 11, each of the states (b), (c), and (d) is a pattern in which aprocess is performed over the area A and the area B. In this case, thevalue of the counter vacnt is “vacnt (max)−d+2≦vacnt≦vacnt (max)”, withthe maximum vacnt (max) of the counter vacnt at the time of the reducingprocess and the band process width d as variables. In the configurationemployed in a known image forming apparatus, all the sub-scanningpositions in an area can be the position at which an insertion or adeletion of a pixel occurs. Further, a random number value rnd may begenerated in the range of “0≦rnd≦ay−1”, and a single scan may beperformed over two areas. In this case, it is necessary to compare acounter vacnt with a random number value rnd for each of the area A andthe area B. That is, it will be necessary to store and maintain a randomnumber value for both areas. Further, when processing is performed overtwo areas, a deletion of a pixel may be performed twice in the same mainscanning position. An example of this case will be described in detailwith reference to FIG. 12.

FIG. 12 is a diagram explaining a relation of a line buffer and anoutput image in an exemplary reducing process. In the reducing process,a main scanning position x is 5 (x=5), a random number value for thearea A is 8, and a random number value for the area B is 1. In FIG. 12,the random number value rnd (A) for the area A is “8”, and the randomnumber value rnd (B) of the area B is “1”. For this reason, two pixels,i.e., a deletion candidate 1 (linebuf1 (A)) and a deletion candidate 2(linebuf4 (D)), which are on the same main scanning line, are deleted.In an output image, the line buffers are shifted by 2 pixels in thesub-scanning direction, therefore, the output image consists of line 1(B), line 2 (C), line 3 (E), and line 4 (F), as illustrated in FIG. 12.That is, in the reducing process in this case, the number L of the linebuffer 53 needs to be the sum of the band process width d and 2 lines,i.e., d+2 lines.

In the image forming apparatus 110 of this embodiment, the range of arandom number value rnd is restricted. For example, the range of arandom number value rnd is controlled so that a pixel which is a targetof an insertion or a deletion should appear in a process performed inscans before the scan over the area A and the area B. As a result, inthe scan over the area A and the area B, a random number value rnd forthe area A is no longer needed, and only a random number value rnd forthe area B is needed. Further, in one scan, two or more deletions of apixel in the same main scanning position do not occur. Therefore, “d+2”lines are sufficient for the number of line buffer 53. As illustrated inFIG. 11, the range of random number value rnd is “0≦rnd≦vacnt(max)−d+1”. By satisfying this condition, in the process of step S702,even if the condition “vacnt (0) vacnt (max)−d+1” is not filled, it isnot necessary to refer to the random number value for the area A, andthe process can proceed to the process of step S707.

Returning to FIG. 10, the CPU 51 compares 1) the value of the randomnumber value rnd corresponding to the main scanning position x which isobtained by the process of step S518 (FIG. 5) with 2) the value of thecounter vacnt (0) (S703). When the result is “rnd≦vacnt (0)”, (S703:yes), the process proceeds to step S704. If not (S703: no), the processproceeds to Step S707. The CPU 51 compares 1) the value of the randomnumber value rnd corresponding to the main scanning position x which isobtained by the process of step S518 (FIG. 5) with 2) the value of thecounter vacnt (0) (S704). When the result is “rnd=vacnt (0)”, (S704:yes), the process proceeds to step S705. If not (S704: no), the processproceeds to Step S706.

The CPU 51 performs a reducing process (magnification changing outputprocess) (S705). Specifically, in the process concerning the countervacnt (0), the data corresponding to the main scanning position x isobtained from the line buffer L1 and it is output. In the processconcerning the counter vacnt (1), the data corresponding to the mainscanning position x is obtained from the line buffer L2, and it isoutput. In the process concerning the counter vacnt (2), the datacorresponding to the main scanning position x is obtained from the linebuffer L3, and it is output. In the process concerning the counter vacnt(3), the data corresponding to the main scanning position x is obtainedfrom the line buffer L4, and it is output. Due to these processes, ineach position of the area which is specified by the random number valuernd, 1 pixel is deleted.

The CPU 51 performs output processing before the random number position(S705). The output processing before the random number position in thiscase is the normal image output process which does not perform amagnification changing process in the reducing process. Specifically, inthe process concerning the counter vacnt (0), the data corresponding tothe main scanning position x is obtained from the line buffer L0 and itis output. In the process concerning the counter vacnt (1), the datacorresponding to the main scanning position x is obtained from the linebuffer L1, and it is output. In the process concerning the counter vacnt(2), the data corresponding to the main scanning position x is obtainedfrom the line buffer L2, and it is output. In the process concerning thecounter vacnt (3), the data corresponding to the main scanning positionx is obtained from the line buffer L3, and it is output.

The CPU 51 performs output processing after the random number position(S707). In this case, the reducing process has already been performedbefore the area including the count vacnt (0) to the count vacnt (3).Due to this, in the output processing after the random number position,the pixel at one line advanced position is output. Specifically, in theprocess concerning the counter vacnt (0), the data corresponding to themain scanning position x is obtained from the line buffer L1 and it isoutput. In the process concerning the counter vacnt (1), the datacorresponding to the main scanning position x is obtained from the linebuffer L2, and it is output. In the process concerning the counter vacnt(2), the data corresponding to the main scanning position x is obtainedfrom the line buffer L3, and it is output. In the process concerning thecounter vacnt (3), the data corresponding to the main scanning positionx is obtained from the line buffer L4, and it is output.

FIG. 13 is an exemplary diagram explaining a reducing process of thisembodiment. In FIG. 13, the input image, the image data to be stored ineach of the line buffers L0, L1, L2, L3 and L4, and the random numbervalue (A, B) are schematically illustrated. Further, in FIG. 13, theoutput image data and the values of counter vacnt (0) from the vacnt (3)are illustrated and arranged for each scan (from scan 1 to scan 5).

Now, the enlarging process in the printer mode is explained. Fundamentalprocess procedures are followed according to the case of the reducingprocess. Hereinafter, description is made focusing on the processprocedures which differ from process procedures in the case of thereducing process. Further, description is made in a case where a mainscanning direction input image size in_x is 14 pixels, and asub-scanning direction input image size in_y is 20 pixels, the bandprocess width d is 4 pixels (4 lines), and the magnification P is111.1111 . . . [%]. In addition, the line number L of the line buffers53 is 5 (d+1=4+1=5), and each line of the line buffer 53 is defined as aline buffer L0, L1, L2, L3, and L4.

In the process in step S502 (FIG. 4), the CPU 51 obtains themagnification information (i.e., the value of the magnification p) fromthe external PC 48. Specifically, the value is 111.111111 . . . [%]. Inthe process in step 503 (FIG. 4), The CPU 51 divides an input imagealong the sub-scanning direction, and calculates the number of pixels ofa sub-scanning length ay for every divided area. In the enlargingprocess, ay can be obtained by the following formula 3, since one pixelis inserted from the pixel sequence of the sub-scanning direction ineach area.

(ay+1)/ay=p/100  (formula 3)

The formula 3 can be written as a following formula 4.

ay=100/(p−100)  (formula 4)

The sub-scanning length ay in the enlarging process is set toay=100/(111.111111−100)=9 [pixels]. This means that the insertion of onepixel is performed at a frequency of one time per 9 lines.

In the process of step S522 (FIG. 5), the CPU 51 updates the countervacnt (S522). Specifically, adding “4” to each of the values of thecount vacnt (0) to count vacnt (3). However, as described above, themaximum vacnt (max) of the counter vacnt at the time of the enlargingprocess, vacnt (max)=ay−1+1. Therefore, when the maximum value isexceeded, restarting the count from “0” for the count in excess of thevalue of the maximum vacnt. As an example, description is made in a casewhere update is performed with ay=11, vacnt (max)=9, vacnt (0)=5, vacnt(1)=6, vacnt (2)=7, and vacnt (3)=8.

In this case, the counter vacnt (0) to the counter vacnt (3) are updatedas shown in the following (a)-(d):

(a) vacnt (0): 5+4=9, thus the vacnt (0)=9:

(b) vacnt (1): 6+4=10, thus the vacnt (1)=0;

(c) vacnt (2): 7+4=11, thus the vacnt (2)=1;

(d) vacnt (3): 8+4=12, thus the vacnt (3)=2.

Description is specifically made with regard to step S519 illustrated inFIG. 5 in the enlarging process with reference to FIG. 10. As in thereducing process, for each of the counter vacnt (0), the counter vacnt(1), the counter vacnt (2), and the counter vacnt (3), the process isperformed in the enlarging process. In the process of step S701 (FIG.10), the CPU 51 determines, based on the value of the magnification p,whether the process is the reducing process or the enlarging process(S510). Here, since the process is an enlarging process (S701: no), theprocess proceeds to Step S708 (FIG. 10). Description is made with regardto each of steps S708 to S713.

The CPU 51 compares the counter vacnt (0) with the sub-scanning lengthay and the band process width d in each area (S708). Specifically, whenthe formula “vacnt (0)≦vacnt(max)−d+1” is satisfied (S708: yes), theprocess proceeds to step S709. If not (S708: no), the process proceedsto Step S713. The CPU 51 compares 1) the value of the random numbervalue rnd corresponding to the main scanning position x which isobtained by the process of step S518 (FIG. 5), with 2) the value of thecounter vacnt (0) (S709). When the result is “rnd≦vacnt (0)”, (S709:yes), the process proceeds to step S710. If not (S709: no), the processproceeds to Step S713. The CPU 51 compares 1) the value of the randomnumber value rnd corresponding to the main scanning position x which isobtained by the process of step S518 (FIG. 5) with 2) the value of thecounter vacnt (0) (S710). When the result is “rnd=vacnt(0)”, (S710:yes), the process proceeds to step S711. If not (S710: no), the processproceeds to Step S712.

The CPU 51 performs an enlarging process (magnification changing outputprocess) (S711). Specifically, in the process concerning the countervacnt (0), the data corresponding to the main scanning position x isobtained from the line buffer L0 and it is output. In the processconcerning the counter vacnt (1), the data corresponding to the mainscanning position x is obtained from the line buffer L1, and it isoutput. In the process concerning the counter vacnt (2), the datacorresponding to the main scanning position x is obtained from the linebuffer L2, and it is output. In the process concerning the counter vacnt(3), the data corresponding to the main scanning position x is obtainedfrom the line buffer L3, and it is output. Due to these processes, ineach position of the area which is specified by the random number valuernd, 1 pixel is inserted.

The CPU 51 performs output processing before the random number position(S712). The output processing before the random number position in thiscase is the normal image output process which does not perform amagnification changing process in the enlarging process. Specifically,in the process concerning the counter vacnt (0), the data correspondingto the main scanning position x is obtained from the line buffer L1 andit is output. In the process concerning the counter vacnt (1), the datacorresponding to the main scanning position x is obtained from the linebuffer L2, and it is output. In the process concerning the counter vacnt(2), the data corresponding to the main scanning position x is obtainedfrom the line buffer L3, and it is output. In the process concerning thecounter vacnt (3), the data corresponding to the main scanning positionx is obtained from the line buffer L4, and it is output.

The CPU 51 performs output processing after the random number position(S713). In this case, the enlarging process has already been performedbefore the area including the count vacnt (0) to the count vacnt (3).Due to this, in the output processing after the random number position,the pixel at one line behind position is output. Specifically, in theprocess concerning the counter vacnt (0), the data corresponding to themain scanning position x is obtained from the line buffer L0 and it isoutput. In the process concerning the counter vacnt (1), the datacorresponding to the main scanning position x is obtained from the linebuffer L1, and it is output. In the process concerning the counter vacnt(2), the data corresponding to the main scanning position x is obtainedfrom the line buffer L2, and it is output. In the process concerning thecounter vacnt (3), the data corresponding to the main scanning positionx is obtained from the line buffer L3, and it is output.

FIG. 14 is an exemplary diagram explaining an enlarging process of thisembodiment. In FIG. 14, the input image (areas A, B and C), the imagedata to be stored in each of the line buffers L0, L1, L2, L3 and L4, andthe random number value (A, B and C) are schematically illustrated.Further, in FIG. 14, the output image data and the values of countervacnt (0) from the vacnt (3) are illustrated and arranged for each scan(from scan 1 to scan 6).

It is noted that even if the image forming apparatus 110 is in the copymode, the reducing process or the enlarging process is performed similarto the case in the printer mode. The copy mode differs from the printermode in a point that the image forming apparatus 110, for transmittingor receiving signals and various data, does not communicate with theexternal PC 48, rather, it communicates with the panel 49, scanner unit4 and image sensor 9. In this case, the image formation start signal Pin the printer mode is replaced with the image formation start signal Cin the copy mode. The magnification P in the printer mode is replacedwith the magnification C in the copy mode. The image data request signalP in the printer mode is replaced with the image data request signal Cin the copy mode. The image data P in the printer mode is replaced withthe image data request signal C in the copy mode.

Thus, in the image forming apparatus 110 of this embodiment, the CPU 51determines the range of a random number value rnd, which is generated bythe random number generator, based on the scanning width (i.e., bandprocess width d) and the length (i.e., sub-scanning length ay) in thedirection of the sub-scanning in the area. Specifically, a generatedrandom number value rnd is restricted within the range of “0” to“maximum vacnt (max) of the counter vacnt−band process width d+1” from“0”. The image forming apparatus 110 receives a random number value rnd,which is in the above range, and performs image processing by insertinga pixel, or by deleting a pixel, at the position determined by thereceived random number value rnd. Thereby 1) the number L of the linebuffer 53 which is required when performing a magnification changingprocess, and 2) the number of the random number generation circuits canbe reduced. Further, the reduction of the manufacture cost of the imageforming apparatus 110 can be achieved. In the reduction processing,since vacnt (max)=ay−1−1, “maximum vacnt (max) of the counter vacnt−bandprocess width d+1” is expressed as “sub-scanning length ay−band processwidth d−1”. That is, this value is less than or equal to the valueobtained by subtracting the value of the band width d from the value ofthe sub-scanning length ay and further subtracting “1” (−1). In theenlarging processing, since vacnt (max)=ay−1+1, “maximum vacnt (max) ofthe counter vacnt−band process width d+1” is expressed as “sub-scanninglength ay−band process width d+1”. That is, this value is less than orequal to the value obtained by subtracting the value of the band width dfrom the value of the sub-scanning length ay and further adding “1”(+1).

In the above embodiment, description is made in a case where the valueof sub-scanning length ay of each divided area is constant. Notrestricted to this, the values of the sub-scanning length ay may differin each area. In this case, in the formula based on the value of thesub-scanning length ay, the value of the sub-scanning length ay of thearea to be processed may be used. Further, the sub-scanning length aymay not be an integer (i.e., having fractional part), for example, thecalculated result ay may be 10.5. In this case, an area with ay=10 andan area with ay=11 are alternately provided for accommodating thesub-scanning length.

Further, in the above embodiments, when a random number value rndgenerated in each process of steps S602 to S604 illustrated in FIG. 8 isout of the determined range, generation flows are repeated until arandom number value rnd which is within the range. In addition, thenumber of bits may be determined so that the generated random numbervalue should be within the range. For example, when the range of arandom number value rnd is determined to be 0 to 6, in place of findingthe minimum index n which satisfies the condition “2^(n) exceeds themaximum value of the random number”. the maximum index n which satisfiesthe condition “2^(n) does not exceed the maximum value of the randomnumber” may be found. In this case, n is determined to be 2 (n=2), thismeans that a random number value with 2 bits is generated. That is, therange within which a random number value rnd is generated is 0 to 3. Inthis case, since a generated random number value rnd is certainlysmaller than the maximum value 6, the process of step S604 (FIG. 8) iseliminated.

In the expansion process, since an insertion of a pixel is performed,unlike the case where a pixel is deleted, when inserting a pixel, it isnot necessary to prepare new data. However, when the input image isinput per the fixed number of lines and if the data is of a type inwhich the data cannot be read after reading out, it has an effect ofreducing line buffers. In the image forming apparatus of such aconfiguration, it is necessary to store data shifted in the behindposition in the enlarging process in a line buffer. That is, since aninsertion of a pixel may be performed 2 times in one scan, the imagedata for two lines may be necessary for the following scan. Therefore,by restricting a random number value rnd within a range of “0” to “themaximum value vacnt (max) of the counter vacnt−the band process widthd+1”, the number of lines of line buffers can be reduced.

As mentioned above, according to the present disclosure, a range of agenerated random number value is determined according to a length ofscanning width and a sub-scanning direction of an area. When performingimage processing, a pixel is inserted at a position defined based on arandom number value which is within the range, or a pixel at theposition is deleted. Therefore, a random value used in an imageprocessing is restricted to be within a determined range. Thus, thenumber of random number generation circuits and the required number ofline buffers when performing a magnification changing process arereduced. Further, the reduction of the manufacture cost of an imageforming apparatus may be achieved.

The present invention has been described in detail by way of theabove-mentioned embodiments, but the scope of the present invention isnot limited to those embodiments.

While the present invention has been described with reference toexemplary embodiments, it is to be understood that the invention is notlimited to the disclosed exemplary embodiments. The scope of thefollowing claims is to be accorded the broadest interpretation so as toencompass all such modifications and equivalent structures andfunctions.

This application claims the benefit of Japanese Patent Application No.2014-071949, filed Mar. 31, 2014 which is hereby incorporated byreference wherein in its entirety.

What is claimed is:
 1. An image forming apparatus comprising: a dividingunit configured to divide received image data into two or more areas; arandom number generation unit configured to generate a random numbervalue for specifying a position for inserting or deleting a pixel foreach divided area; a determination unit configured to determine a rangeof a random number value generated by the random number generation unitbased on a scanning width of in a scan of the image data in a mainscanning direction and a length in a sub-scanning direction of the area;and an image processing unit configured to perform image processing forinserting or deleting a pixel at the specified position specified by therandom number value within the determined range.
 2. The image formingapparatus according to claim 1, wherein the width in the sub-scanningdirection in the scan at one time is narrower than the width of the areain the sub-scanning direction.
 3. The image forming apparatus accordingto claim 1, wherein: the input image data is a set of pixels arranged inthe main scanning direction and in the sub-scanning direction of theimage, and the range determined by the determination unit is a range inwhich, in each of a sequence of the pixels which is parallel to thesub-scanning direction in the said area, two or more deletions orinsertions of a pixel in the scan at one time does not occur.
 4. Theimage forming apparatus according to claim 1, wherein: the determinationunit is further configured to determine the range of the random numbervalue generated by the random number generation unit when a scan isperformed over a plurality of the areas at one time.
 5. An image formingapparatus according to claim 1, wherein: the determination unit isfurther configured to: 1) determine whether the scan at one time isperformed over a plurality of the areas or not; and 2) determine, whenthe scan is performed on the plurality of the areas, the range of arandom number value generated by the random number generation unit suchthat two or more deletions or insertions of a pixel do not occur in therange.
 6. The image forming apparatus according to claim 1, wherein: thedetermination unit is further configured to determine the range of arandom number value when performing image processing for reducing orenlarging the image in the sub-scanning direction.
 7. An image formingapparatus according to claim 6, wherein the determination unit isfurther configured to determine the range of the random number valuesuch that a first range and a second range differ each other, and: 1)the first range is the range of the random number value in case wherethe image processing for reducing the image in the sub-scanningdirection is performed; and 2) the second range is the range of therandom number value in case where the image processing for enlarging theimage in the sub-scanning direction is performed.
 8. The image formingapparatus according to claim 1, wherein the scanning width is a widthrepresented by the number of pixels, and the determination unit isfurther configured to: 1) set “0” for the minimum number of the randomnumber value generated by the random number generation unit; and 2)determine, when performing image processing for reducing the image inthe sub-scanning direction by deleting a pixel in the area, the range ofthe random number value such that a maximum value of the random numbervalue is less than or equal to a value obtained by subtracting the scanwidth from the number of the pixels in the sub-scanning direction in thearea and further subtracting “1” from the result of the subtraction. 9.An image forming apparatus according to claim 1, the scan width is awidth represented by the number of the pixels, the determination unit isfurther configured to: 1) set “0” for minimum number of the randomnumber value generated by the random number generation unit; and 2)determine, when performing image processing for enlarging the image inthe sub-scanning direction by inserting a pixel in the area, the rangeof the random number value such that a maximum value of the randomnumber value is less than or equal to a value obtained by subtractingthe scan width from the number of the pixels in the sub-scanningdirection in the area and adding “1” from the result of the subtraction.10. An image forming apparatus according to claim 1, wherein thedetermination unit is further configured to: 1) determine the maximumnumber of a random number based on the scan width, and 2) when at leastone of two or more random number values, which is generated by therandom number generation unit for the scan at one time, is larger thanthe maximum value of the random number value, causing the random numbergeneration unit to generate a random number again.